import { getCookie } from '@/utils/cookie'
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => ({
    permissions: getCookie('resourceIds') || ''
  }),
  getters: {
    auth(): string[] {
      return this.permissions.split(',')
    }
  },
  actions: {
    setPermission(privi: string) {
      this.permissions = privi
    }
  }
})
